//
//  SetTableViewCell.m
//  TeamInformatization
//
//  Created by bigger on 2019/3/31.
//  Copyright © 2019年 SPIC. All rights reserved.
//

#import "SetTableViewCell.h"

@interface SetTableViewCell ()

@property (nonatomic, strong) SimpleLabel *setTitle;

@property (nonatomic, strong) SimpleLabel *setContent;

@end


@implementation SetTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatCellView];
        
        self.backgroundColor = [UIColor whiteColor];
        // 取消cell选中状态
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)creatCellView
{
    self.setTitle = [SimpleLabel initWithText:@"" TextColor:kTitleTextColor TextFont:[UIFont systemFontOfSize:15] TextAlignment:NSTextAlignmentLeft];
    [self addSubview:_setTitle];
    [_setTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15 * kScaleWidth);
        make.centerY.mas_equalTo(self);
    }];
    
    self.setContent = [SimpleLabel initWithText:@"" TextColor:kSubTitleTextColor TextFont:[UIFont systemFontOfSize:13] TextAlignment:NSTextAlignmentRight];
    [self addSubview:_setContent];
    [_setContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10 * kScaleWidth);
        make.centerY.mas_equalTo(self);
    }];
    
    // 分割线
    UILabel *lineLabel = [[UILabel alloc] init];
    lineLabel.backgroundColor = kCuttingLineColor;
    [self addSubview:lineLabel];
    [lineLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.left.mas_equalTo(15 * kScaleWidth);
        make.right.mas_equalTo(-10 * kScaleWidth);
        make.height.mas_equalTo(0.5);
    }];
    
}

- (void)setCellTitle:(NSString *)title ContentText:(NSString *)content
{
    _setTitle.text = title;
    _setContent.text = content;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
